<?php

class ome_finder_accountperiod
{

	var $column_edit = '操作';
	var $column_edit_width = "150";

  	var $detail_log = "操作日志";
    function detail_log($id){
        $render = app::get('ome')->render();
        $oOperation_log = app::get('ome')->model('operation_log');
        $render->pagedata['log'] = $oOperation_log->read_log(array('obj_type'=>'accountperiod@ome','obj_id'=>$id),0,20,'log_id desc');
        return $render->fetch('admin/accountperiod/detail_log.html');
    }
	public function column_edit($row)
	{
		$finder_id = $_GET['_finder']['finder_id'];

        $accountperiodML = app::get('ome')->model('accountperiod');//物流公司
        $accountperiod_data=$accountperiodML->getList('*', array('id' => $row['id']),0,1);

		if($accountperiod_data[0]['status']==0)
		{
			$edit='<a href="index.php?app=ome&ctl=admin_accountperiod&act=setApprove&p[0]=' . $row['id'] . '&p[1]=0&finder_id='.$finder_id.'" target="download">启用</a>';
		}elseif($accountperiod_data[0]['status']==1)
		{
			$unapprove='<a href="index.php?app=ome&ctl=admin_accountperiod&act=setApprove&p[0]=' . $row['id'] . '&p[1]=1&finder_id='.$finder_id.'" target="download">禁用</a>';
			$close='<a href="index.php?app=ome&ctl=admin_accountperiod&act=setclose&p[0]=' . $row['id'] . '&p[1]=0&finder_id='.$finder_id.'" target="download">关帐</a>';
		}elseif($accountperiod_data[0]['status']==2)
		{
			$unclose='<a href="index.php?app=ome&ctl=admin_accountperiod&act=setclose&p[0]=' . $row['id'] . '&p[1]=1&finder_id='.$finder_id.'" target="download">取消关帐</a>';
		}		
		return $edit.' '.$unapprove.' '.$close.' '.$unclose;
	}

}